
const {createMoment ,getMomentDetails,getMomentList,updateMoment,deleteMoment,getFileInfoByfilename} =require('../controllers/moment')
const router = require('koa-router'); // 引入路由
const {verify_auth ,verifyPermission} =require('../middleware/auth')  // 引入鉴权   鉴权中间件
const momentRouter = new router({
  prefix: '/moment'
});
// 创建动态
momentRouter.post('/',verify_auth, createMoment);
// 获取动态
momentRouter.get('/:momentId', getMomentDetails);
//
momentRouter.get('/', getMomentList);
//修改动态
momentRouter.patch('/:momentId',verify_auth,verifyPermission, updateMoment);
//删除动态
momentRouter.delete('/:momentId',verify_auth,verifyPermission, deleteMoment);

//
momentRouter.get('/images/:filename',getFileInfoByfilename);
module.exports = momentRouter;